<?php
require('config.php');
//print "connecting";
mysql_connect("mysql-starka.x10hosting.com",$user,$password);
mysql_select_db($database) or die( "Unable to select database");

if(isset($_GET['keyword']))	{
    $query="SELECT (FA_Sat + FA_Mono + FA_Poly) AS Tot_Fat, Water, Energ_Kcal, Protein, Lipid_Tot, Ash, Carbohydrt, Fiber_TD, Sugar_Tot, Calcium, Iron, Magnesium, Phosphorus, Potassium, Sodium, Zinc, Copper, Manganese, Selenium, Vit_C, Thiamin, Riboflavin, Niacin, Panto_Acid, Vit_B6, Folate_Tot, Folic_Acid, Food_Folate, Folate_DFE, Choline_Tot, Vit_B12, Vit_A_IU, Vit_A_RAE, Retinol, Alpha_Carot, Beta_Carot, Beta_Crypt, Lycopene, Lut_Zea, Vit_E, Vit_D_mcg, ViVit_D_IU, Vit_K, FA_Sat, FA_Mono, FA_Poly, Cholestrl FROM sr22 WHERE Shrt_Desc LIKE '". mysql_real_escape_string($_GET['keyword']) ."%' LIMIT 1;";
    $results=mysql_query($query);
    $row=mysql_fetch_assoc($results);
    ksort($row);
    foreach($row as $key => $val){
    print("$key::$val\n");}
    print("EOF");
}
mysql_close();
?>